package main

import (
	"io"
	"os"
)

func main() {
	f, _ := os.OpenFile("test.txt", os.O_APPEND|os.O_CREATE|os.O_RDWR, 0755)
	defer f.Close()

	var i io.Reader = f

	switch v := i.(type) {
	case io.ReadWriter:
		v.Write([]byte("ReadWriter12321321"))
	case *os.File:
		v.Write([]byte("File12321321"))
	default:
		return
	}

}
